<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!-- 
	Copyright (C) 2007, 2008, 2009, 2010, 2011. PARP Research Group.
	<http://perception.inf.um.es>
	University of Murcia, Spain.

	This file is part of the QVision library.

	QVision is free software: you can redistribute it and/or modify
	it under the terms of the GNU Lesser General Public License as
	published by the Free Software Foundation, version 3 of the License.

	QVision is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public
	License along with QVision. If not, see <http://www.gnu.org/licenses/>.
-->

<html><head><meta http-equiv="content-Type" content="text/html;charset=UTF-8">
<title>QVision: Qt&#39;s Image, Video and Computer Vision Library</title>
<meta name="title" content="QVision" />
<meta name="dc.title" content="QVision" />
<meta name="url" content="http://perception.inf.um.es/QVision" />
<meta name="author" content="PARP Research Group - http://perception.inf.um.es" />
<meta name="revisit-after" content="30 DAYS"/>
<meta name="robots" content="index,follow"/>
<meta name="classification" content="*">
<meta name="rating" content="Safe For Kids">
<meta name="distribution" content="GLOBAL"/>
<meta name="description" content="Qt's Image, Video and Computer Vision Library"/>
<meta name="page-topic" content="Computer Vision research and prototype programming"/>
<meta name="geo.country" content="ES" />

<!--
Keywords:
By license:		open source, gnu, lgpl, gpl, free
By theme:		computer vision, image processing, robotics, programming, source, development
By usage:		library, toolkit, framework, prototype, application
By programming specs:	object oriented, c++, block programming, reusability, gui, graphical, parallel computing, high performance, GPU, prototyping
Interoperability with:	Qt, GSL, GNU Scientific library, OpenCV, CGAL, QWT, CUDA, mplayer, IPP, Intel Image Performance Primitives, blas, lapack
Functionallity:		image features, matrix algebra, projective geometry, mser, function minimization, function optimization, canny operator, harris operator, corner detection, performance evaluation, cpu usage, graphical interface
Main data-types:	matrix, vector, tensor, quaternion, image, polyline
Video sources:		webcam, camera, stream
Devices:		embedded, desktop computer, laptop, mini-laptop
Authors:		PARP research group. University of Murcia, Spain.
-->

<meta name="keywords" content="augmented reality, sfm, structure from motion, open source, gnu, lgpl, gpl, free, computer vision, image processing, robotics, programming, source, development, library, toolkit, framework, prototype, application, object oriented, c++, block programming, reusability, gui, graphical, parallel computing, high performance, GPU, prototyping, Qt, GSL, GNU Scientific library, OpenCV, CGAL, QWT, CUDA, mplayer, IPP, Intel Image Performance Primitives, blas, lapack, image features, matrix algebra, projective geometry, mser, function minimization, function optimization, canny operator, harris operator, corner detection, performance evaluation, cpu usage, graphical interface, matrix, vector, tensor, quaternion, image, polyline, webcam, camera, stream, embedded, desktop computer, laptop, mini-laptop, University of Murcia, Spain, PARP research group, vision por computador"/>
<meta http-equiv="keywords" content="augmented reality, sfm, structure from motion, open source, gnu, lgpl, gpl, free, computer vision, image processing, robotics, programming, source, development, library, toolkit, framework, prototype, application, object oriented, c++, block programming, reusability, gui, graphical, parallel computing, high performance, GPU, prototyping, Qt, GSL, GNU Scientific library, OpenCV, CGAL, QWT, CUDA, mplayer, IPP, Intel Image Performance Primitives, blas, lapack, image features, matrix algebra, projective geometry, mser, function minimization, function optimization, canny operator, harris operator, corner detection, performance evaluation, cpu usage, graphical interface, matrix, vector, tensor, quaternion, image, polyline, webcam, camera, stream, embedded, desktop computer, laptop, mini-laptop, University of Murcia, Spain, PARP research group, vision por computador"/>
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="title" content="QVision"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="tabs.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="favicon.ico" />
</head><body>

<table width="100%"><tr>
	<td><a href="http://perception.inf.um.es/"><img src="parp.png" border="0" /> <big>PARP Research Group</big></a></td>
	<td align="right"><a href="http://www.um.es/"><big>Universidad de Murcia</big> <img src="um.png" border="0" /></a></td>
</tr></table>

<hr /><br />

<table width="95%" align="center"><tr><td>

<!-- Generated by Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
          <form id="FSearchBox" action="search.php" method="get">
            <img id="MSearchSelect" src="search/search.png" alt=""/>
            <input type="text" id="MSearchField" name="query" value="Search" size="20" accesskey="S" 
                   onfocus="searchBox.OnSearchFieldFocus(true)" 
                   onblur="searchBox.OnSearchFieldFocus(false)"/>
          </form>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>src/qvmath/qvvector.h</h1><a href="qvvector_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> *      Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012. PARP Research Group.</span>
<a name="l00003"></a>00003 <span class="comment"> *      &lt;http://perception.inf.um.es&gt;</span>
<a name="l00004"></a>00004 <span class="comment"> *      University of Murcia, Spain.</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> *      This file is part of the QVision library.</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> *      QVision is free software: you can redistribute it and/or modify</span>
<a name="l00009"></a>00009 <span class="comment"> *      it under the terms of the GNU Lesser General Public License as</span>
<a name="l00010"></a>00010 <span class="comment"> *      published by the Free Software Foundation, version 3 of the License.</span>
<a name="l00011"></a>00011 <span class="comment"> *</span>
<a name="l00012"></a>00012 <span class="comment"> *      QVision is distributed in the hope that it will be useful,</span>
<a name="l00013"></a>00013 <span class="comment"> *      but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00014"></a>00014 <span class="comment"> *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00015"></a>00015 <span class="comment"> *      GNU Lesser General Public License for more details.</span>
<a name="l00016"></a>00016 <span class="comment"> *</span>
<a name="l00017"></a>00017 <span class="comment"> *      You should have received a copy of the GNU Lesser General Public</span>
<a name="l00018"></a>00018 <span class="comment"> *      License along with QVision. If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00019"></a>00019 <span class="comment"> */</span>
<a name="l00020"></a>00020 
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="preprocessor">#ifndef QVVECTOR_H</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">#define QVVECTOR_H</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;math.h&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;QVector&gt;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;QPointF&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;<a class="code" href="qvdefines_8h.html" title="File from the QVision library.">qvdefines.h</a>&gt;</span>
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="preprocessor">#ifdef GSL_AVAILABLE</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#include &lt;gsl/gsl_linalg.h&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#endif</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span>
<a name="l00038"></a>00038 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#ifdef max</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#undef max</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#endif // max</span>
<a name="l00042"></a>00042 <span class="preprocessor"></span>
<a name="l00043"></a>00043 <span class="preprocessor">#ifdef min</span>
<a name="l00044"></a>00044 <span class="preprocessor"></span><span class="preprocessor">#undef min</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#endif // min</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#endif // _MSC_VER</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span>
<a name="l00048"></a>00048 <span class="keyword">class </span><a class="code" href="classQVMatrix.html" title="Implementation of numerical matrices.">QVMatrix</a>;
<a name="l00049"></a>00049 
<a name="l00058"></a><a class="code" href="classQVVector.html">00058</a> <span class="keyword">class </span><a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a>: <span class="keyword">public</span> QVector&lt;double&gt;
<a name="l00059"></a>00059     {
<a name="l00060"></a>00060     <span class="keyword">public</span>:
<a name="l00064"></a><a class="code" href="classQVVector.html#a87f1f96ea24455e4629c3938a3a235c1">00064</a>         <a class="code" href="classQVVector.html#a87f1f96ea24455e4629c3938a3a235c1" title="Default constructor for QVVector.">QVVector</a>(): QVector&lt;double&gt;()                                                                   {}
<a name="l00065"></a>00065 
<a name="l00070"></a><a class="code" href="classQVVector.html#a5a8cffeb9c8ad0e87368a3e8788a8752">00070</a>         <a class="code" href="classQVVector.html#a5a8cffeb9c8ad0e87368a3e8788a8752" title="Constructor for QVVector.">QVVector</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> size, <span class="keyword">const</span> <span class="keywordtype">double</span> defaultValue = 0): QVector&lt;double&gt;(size, defaultValue)    {}
<a name="l00071"></a>00071 
<a name="l00076"></a><a class="code" href="classQVVector.html#ad5399f02b9f5f3ac4ec4fd9641783c67">00076</a>         <a class="code" href="classQVVector.html#a87f1f96ea24455e4629c3938a3a235c1" title="Default constructor for QVVector.">QVVector</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> size, <span class="keyword">const</span> <span class="keywordtype">double</span> *defaultValues): QVector&lt;double&gt;(size)
<a name="l00077"></a>00077             {
<a name="l00078"></a>00078             <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; size; i++)
<a name="l00079"></a>00079                 <span class="keyword">operator</span>[](i) = defaultValues[i];
<a name="l00080"></a>00080             }
<a name="l00081"></a>00081 
<a name="l00085"></a><a class="code" href="classQVVector.html#ad5f4b0a665b20f1589cb7717bd2bb907">00085</a>         <a class="code" href="classQVVector.html#ad5f4b0a665b20f1589cb7717bd2bb907" title="Copy constructor for QVVector.">QVVector</a>(<span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;vector): QVector&lt;double&gt;(vector)                                       {}
<a name="l00086"></a>00086 
<a name="l00090"></a><a class="code" href="classQVVector.html#a1dcd237406a7bdf557d498e35949d6f2">00090</a>         <a class="code" href="classQVVector.html#a1dcd237406a7bdf557d498e35949d6f2" title="Copy constructor for QVector.">QVVector</a>(<span class="keyword">const</span> QVector&lt;double&gt; &amp;vector): QVector&lt;double&gt;(vector)                                {}
<a name="l00091"></a>00091 
<a name="l00095"></a><a class="code" href="classQVVector.html#a3374f129475594d47d3bc6bc5838f9fe">00095</a>         <a class="code" href="classQVVector.html#a3374f129475594d47d3bc6bc5838f9fe" title="Convert constructor from QList.">QVVector</a>(<span class="keyword">const</span> QList&lt;double&gt; &amp;list): QVector&lt;double&gt;(list.toVector())                           {}
<a name="l00096"></a>00096 
<a name="l00103"></a>00103         <a class="code" href="classQVVector.html#a87f1f96ea24455e4629c3938a3a235c1" title="Default constructor for QVVector.">QVVector</a>(<span class="keyword">const</span> <a class="code" href="classQVMatrix.html" title="Implementation of numerical matrices.">QVMatrix</a> &amp;matrix);
<a name="l00104"></a>00104 
<a name="l00109"></a>00109 <span class="preprocessor">        #ifdef GSL_AVAILABLE</span>
<a name="l00110"></a><a class="code" href="classQVVector.html#a9d4bb8f3587fbbfdaedbdca1258bc363">00110</a> <span class="preprocessor"></span>        <a class="code" href="classQVVector.html#a87f1f96ea24455e4629c3938a3a235c1" title="Default constructor for QVVector.">QVVector</a>(<span class="keyword">const</span> gsl_vector *vector): QVector&lt;double&gt;(vector-&gt;size)
<a name="l00111"></a>00111                 {
<a name="l00112"></a>00112                 <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i &lt; size(); i++)
<a name="l00113"></a>00113                     replace(i, gsl_vector_get(vector, i));
<a name="l00114"></a>00114                 }
<a name="l00115"></a>00115 <span class="preprocessor">        #endif</span>
<a name="l00116"></a>00116 <span class="preprocessor"></span>
<a name="l00120"></a><a class="code" href="classQVVector.html#afbf9d1d605f1a4909aad35a792f9c415">00120</a>         <a class="code" href="classQVVector.html#afbf9d1d605f1a4909aad35a792f9c415" title="Convert constructor for QPoint.">QVVector</a>(<span class="keyword">const</span> QPoint &amp;point): QVector&lt;double&gt;(2)       { operator[](0) = point.x(); operator[](1) = point.y(); }
<a name="l00121"></a>00121 
<a name="l00125"></a><a class="code" href="classQVVector.html#ad4def03f464629342b9114f4a5884371">00125</a>         <a class="code" href="classQVVector.html#ad4def03f464629342b9114f4a5884371" title="Convert constructor for QPointF.">QVVector</a>(<span class="keyword">const</span> QPointF &amp;point): QVector&lt;double&gt;(2)      { operator[](0) = point.x(); operator[](1) = point.y(); }
<a name="l00126"></a>00126 
<a name="l00128"></a>00128 
<a name="l00132"></a><a class="code" href="classQVVector.html#a3489b5719cb435b96bf1c533e2be9de9">00132</a>         <span class="keyword">inline</span> <span class="keywordtype">double</span> &amp;<a class="code" href="classQVVector.html#a3489b5719cb435b96bf1c533e2be9de9" title="Element access operator.">operator()</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> index)
<a name="l00133"></a>00133             { <span class="keywordflow">return</span> operator[](index); }
<a name="l00134"></a>00134 
<a name="l00139"></a><a class="code" href="classQVVector.html#aa3b0f3e34215a26e980b3602adf8b7cf">00139</a>         <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classQVVector.html#a3489b5719cb435b96bf1c533e2be9de9" title="Element access operator.">operator()</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> index)<span class="keyword"> const</span>
<a name="l00140"></a>00140 <span class="keyword">            </span>{ <span class="keywordflow">return</span> operator[](index); }
<a name="l00141"></a>00141 
<a name="l00146"></a><a class="code" href="classQVVector.html#acf83ad762d4111599f3a0b8dafd5d981">00146</a>         <span class="keywordtype">double</span> <a class="code" href="classQVVector.html#acf83ad762d4111599f3a0b8dafd5d981" title="Vector dot product.">operator*</a>(<span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;vector)<span class="keyword"> const          </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVVector.html#a9f5e5261bace97f7f315444be9992790" title="Vector dot product.">dotProduct</a>(vector); };
<a name="l00147"></a>00147 
<a name="l00152"></a><a class="code" href="classQVVector.html#a8c8b374af4ed6ecfe301ea434273501f">00152</a>         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a8c8b374af4ed6ecfe301ea434273501f" title="Vector cross product.">operator^</a>(<span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;vector)<span class="keyword"> const        </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVVector.html#aa2784fe126cba704e1801fcfa3b36e30" title="Vector cross product.">crossProduct</a>(vector); };
<a name="l00153"></a>00153 
<a name="l00158"></a><a class="code" href="classQVVector.html#ab53364730dbb375a9660db6514f28061">00158</a>         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#ab53364730dbb375a9660db6514f28061" title="Vector add.">operator+</a>(<span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;vector)<span class="keyword"> const        </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVVector.html#a15bf38ec2d56c24537e118b11bdd1ad7" title="Vector add.">add</a>(vector); };
<a name="l00159"></a>00159 
<a name="l00164"></a><a class="code" href="classQVVector.html#a5f879a38860a97df321eb6cf201b97c5">00164</a>         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a5f879a38860a97df321eb6cf201b97c5" title="Vector substraction.">operator-</a>(<span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;vector)<span class="keyword"> const        </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVVector.html#a6aeacd80798f80447989c0cb016c7a48" title="Vector substraction.">substract</a>(vector); };
<a name="l00165"></a>00165 
<a name="l00171"></a><a class="code" href="classQVVector.html#a3b522f669566e2f638c445d11885de04">00171</a>         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a3b522f669566e2f638c445d11885de04" title="Obtains the additive inverse of the vector.">operator-</a>()<span class="keyword"> const                                      </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVVector.html#acf83ad762d4111599f3a0b8dafd5d981" title="Vector dot product.">operator*</a>(-1.0);       };
<a name="l00172"></a>00172 
<a name="l00173"></a>00173 
<a name="l00178"></a><a class="code" href="classQVVector.html#a6d83fd194bf9a4b60633115463fbb0de">00178</a>         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a6d83fd194bf9a4b60633115463fbb0de" title="Scalar addition.">operator+</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> value)<span class="keyword"> const            </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVVector.html#a752f2f2f18796a3bc883236dea74908e" title="Scalar addition.">scalarAdd</a>(value); };
<a name="l00179"></a>00179 
<a name="l00184"></a><a class="code" href="classQVVector.html#af29ce98af082ff22a9e270240b3f1bfc">00184</a>         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#af29ce98af082ff22a9e270240b3f1bfc" title="Scalar substraction.">operator-</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> value)<span class="keyword"> const            </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVVector.html#a67a7bf9f5130d269aaf8601da877a1aa" title="Scalar substraction.">scalarSubstract</a>(value); };
<a name="l00185"></a>00185 
<a name="l00190"></a><a class="code" href="classQVVector.html#ae078603aca68138f82ec00b612b5bc2d">00190</a>         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#ae078603aca68138f82ec00b612b5bc2d" title="Scalar multiplication.">operator*</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> value)<span class="keyword"> const            </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVVector.html#a0a5c3fd6110fbd8643c618434687eead" title="Scalar multiplication.">scalarProduct</a>(value); };
<a name="l00191"></a>00191 
<a name="l00196"></a><a class="code" href="classQVVector.html#ac1035ab17b6b4095c66fbc27cd3dff65">00196</a>         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#ac1035ab17b6b4095c66fbc27cd3dff65" title="Scalar division.">operator/</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> value)<span class="keyword"> const            </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVVector.html#a943a6862968b73e8d42b18096b992875" title="Scalar division.">scalarDivision</a>(value); };
<a name="l00197"></a>00197 
<a name="l00201"></a>00201         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#acf83ad762d4111599f3a0b8dafd5d981" title="Vector dot product.">operator*</a>(<span class="keyword">const</span> <a class="code" href="classQVMatrix.html" title="Implementation of numerical matrices.">QVMatrix</a> &amp;matrix) <span class="keyword">const</span>;
<a name="l00202"></a>00202 
<a name="l00207"></a><a class="code" href="classQVVector.html#ab24632bd6017f047b0995629a38a7fcb">00207</a>         <span class="keywordtype">bool</span> <a class="code" href="classQVVector.html#ab24632bd6017f047b0995629a38a7fcb" title="Compare operator.">operator==</a>(<span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;vector)<span class="keyword"> const           </span>{ <span class="keywordflow">return</span> <a class="code" href="classQVVector.html#acd3cdacd7ad33bfd723ce694a707f5e7" title="Compare operator.">equals</a>(vector); };
<a name="l00208"></a>00208 
<a name="l00212"></a><a class="code" href="classQVVector.html#a6d8a9cae85983ca7a0f2ddc3c4e79117">00212</a>         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp; <a class="code" href="classQVVector.html#a6d8a9cae85983ca7a0f2ddc3c4e79117" title="Add compound assignment operator.">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;vector)
<a name="l00213"></a>00213             {
<a name="l00214"></a>00214             <span class="keyword">const</span> <span class="keywordtype">int</span> size_ = size();
<a name="l00215"></a>00215             <span class="keyword">const</span> <span class="keywordtype">double</span> *srcData = vector.constData();
<a name="l00216"></a>00216             <span class="keywordtype">double</span> *dstData = data();
<a name="l00217"></a>00217 
<a name="l00219"></a>00219             <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; size_; i++)
<a name="l00220"></a>00220                 dstData[i] += srcData[i];
<a name="l00221"></a>00221 
<a name="l00222"></a>00222             <span class="keywordflow">return</span> *<span class="keyword">this</span>;
<a name="l00223"></a>00223             }
<a name="l00224"></a>00224 
<a name="l00229"></a><a class="code" href="classQVVector.html#a96940793c76e3a8ee5662c6e1d6fc2c7">00229</a>         <a class="code" href="classQVVector.html#a96940793c76e3a8ee5662c6e1d6fc2c7" title="Convert to QPointF operator.">operator QPointF</a>()<span class="keyword"> const</span>
<a name="l00230"></a>00230 <span class="keyword">            </span>{
<a name="l00231"></a>00231             Q_ASSERT(size() &gt; 1);
<a name="l00232"></a>00232             Q_ASSERT(size() &lt; 4);
<a name="l00233"></a>00233             <span class="keywordflow">if</span> (size() == 2)
<a name="l00234"></a>00234                 <span class="keywordflow">return</span> QPointF(<span class="keyword">operator</span>[](0), <span class="keyword">operator</span>[](1));
<a name="l00235"></a>00235             <span class="keywordflow">else</span>
<a name="l00236"></a>00236                 <span class="keywordflow">return</span> QPointF(<span class="keyword">operator</span>[](0)/<span class="keyword">operator</span>[](2), <span class="keyword">operator</span>[](1)/<span class="keyword">operator</span>[](2));
<a name="l00237"></a>00237             }
<a name="l00238"></a>00238 
<a name="l00243"></a>00243 <span class="preprocessor">        #ifdef GSL_AVAILABLE</span>
<a name="l00244"></a><a class="code" href="classQVVector.html#a3415494755e69cc4aad2502b51829904">00244</a> <span class="preprocessor"></span>        <a class="code" href="classQVVector.html#a3415494755e69cc4aad2502b51829904" title="Convert to gsl_vector * operator.">operator gsl_vector * </a>()<span class="keyword"> const</span>
<a name="l00245"></a>00245 <span class="keyword">            </span>{
<a name="l00246"></a>00246             gsl_vector *result = gsl_vector_alloc(size());
<a name="l00247"></a>00247             <span class="keyword">const</span> <span class="keywordtype">double</span> *data = this-&gt;data();
<a name="l00248"></a>00248             <span class="keywordflow">for</span>(uint i = 0; i &lt; result-&gt;size; i++)
<a name="l00249"></a>00249                 gsl_vector_set (result, i, data[i]);
<a name="l00250"></a>00250             <span class="keywordflow">return</span> result;
<a name="l00251"></a>00251             }
<a name="l00252"></a>00252 <span class="preprocessor">        #endif</span>
<a name="l00253"></a>00253 <span class="preprocessor"></span>
<a name="l00255"></a>00255 
<a name="l00259"></a>00259         <span class="keywordtype">int</span> <a class="code" href="classQVVector.html#abf6f01233d14e8be796a5919981ff2f5" title="Gets the location of the element with the maximal value.">maxIndex</a>() <span class="keyword">const</span>;
<a name="l00260"></a>00260 
<a name="l00264"></a>00264         <span class="keywordtype">int</span> <a class="code" href="classQVVector.html#a06bba5625933ab01a23a2f901eae9049" title="Gets the location of the element with the minimal value.">minIndex</a>() <span class="keyword">const</span>;
<a name="l00265"></a>00265 
<a name="l00269"></a>00269         <span class="keywordtype">int</span> <a class="code" href="classQVVector.html#a677b0a1980da08a66e67b15d95a46dda" title="Gets the index of the element with the maximal absolute value.">maxAbsIndex</a>() <span class="keyword">const</span>;
<a name="l00270"></a>00270 
<a name="l00274"></a>00274         <span class="keywordtype">int</span> <a class="code" href="classQVVector.html#a746718c9e2c3a046938dcc6e44b5c1a1" title="Gets the index of the element with the minimal absolute value.">minAbsIndex</a>() <span class="keyword">const</span>;
<a name="l00275"></a>00275 
<a name="l00276"></a>00276 
<a name="l00280"></a>00280         <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keyword">const</span> <span class="keywordtype">double</span> value);
<a name="l00281"></a>00281 
<a name="l00287"></a>00287         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a3206fc1db84f548568298c6326b7c0fa" title="Obtains a sub-vector containing a given range of elements from the original vector...">subVector</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> firstIndex, <span class="keyword">const</span> <span class="keywordtype">int</span> lastIndex) <span class="keyword">const</span>;
<a name="l00288"></a>00288 
<a name="l00293"></a>00293         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a943a6862968b73e8d42b18096b992875" title="Scalar division.">scalarDivision</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> value) <span class="keyword">const</span>;
<a name="l00294"></a>00294 
<a name="l00299"></a>00299         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a752f2f2f18796a3bc883236dea74908e" title="Scalar addition.">scalarAdd</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> value) <span class="keyword">const</span>;
<a name="l00300"></a>00300 
<a name="l00305"></a>00305         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a67a7bf9f5130d269aaf8601da877a1aa" title="Scalar substraction.">scalarSubstract</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> value) <span class="keyword">const</span>;
<a name="l00306"></a>00306 
<a name="l00312"></a>00312         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a7783edc2a21a8d5002ae377ec2a82027" title="Scalar multiplication.">scalarMultiplication</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> value) <span class="keyword">const</span>;
<a name="l00313"></a>00313 
<a name="l00318"></a>00318         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a0a5c3fd6110fbd8643c618434687eead" title="Scalar multiplication.">scalarProduct</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> value) <span class="keyword">const</span>;
<a name="l00319"></a>00319 
<a name="l00323"></a>00323         <span class="keywordtype">double</span> <a class="code" href="classQVVector.html#a49c6f41f1fa80efcc943f1c26fdcbf05" title="Norm 2 of the vector.">norm2</a>() <span class="keyword">const</span>;
<a name="l00324"></a>00324             <span class="comment">//{ return sqrt(*this * *this); }</span>
<a name="l00325"></a>00325 
<a name="l00329"></a>00329         <span class="keywordtype">bool</span> <a class="code" href="classQVVector.html#a29235517605f49f2327df62d5e0295df" title="Checks whether the vector contains a NaN value or not.">containsNaN</a>() <span class="keyword">const</span>;
<a name="l00330"></a>00330 
<a name="l00331"></a>00331 
<a name="l00336"></a>00336         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a42c4fb1fe1e48c0936d662052f84bba0" title="Normalize vector.">normalize</a>() <span class="keyword">const</span>;
<a name="l00337"></a>00337             <span class="comment">//{ return operator/(norm2()); }</span>
<a name="l00338"></a>00338 
<a name="l00341"></a>00341         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a4d544afa97822276b94ba2174023b362" title="Gets the absolute values of the vector elements.">abs</a>() <span class="keyword">const</span>;
<a name="l00342"></a>00342 
<a name="l00345"></a>00345         <span class="keywordtype">double</span> <a class="code" href="classQVVector.html#a6695f3c638ef5e1eb50df4d48d6f6a99" title="Maximal value contained in the vector.">max</a>() <span class="keyword">const</span>;
<a name="l00346"></a>00346 
<a name="l00349"></a>00349         <span class="keywordtype">double</span> <a class="code" href="classQVVector.html#ad25060e9173730d6e1d5a1a116389fe0" title="Minimal value contained in the vector.">min</a>() <span class="keyword">const</span>;
<a name="l00350"></a>00350 
<a name="l00357"></a>00357         <span class="keywordtype">double</span> <a class="code" href="classQVVector.html#aa15b6373a5ca28b1dd82b5b07b71e646" title="Accumulated value.">sum</a>() <span class="keyword">const</span>;
<a name="l00358"></a>00358 
<a name="l00365"></a>00365         <span class="keywordtype">double</span> <a class="code" href="classQVVector.html#a34778251c3900cac4b2e19269fd9be2f" title="Mean value.">mean</a>() <span class="keyword">const</span>;
<a name="l00366"></a>00366 
<a name="l00371"></a>00371         <span class="keywordtype">double</span> <a class="code" href="classQVVector.html#aada9281a571f1a7ef99b161af80b38be" title="Median value.">median</a>() <span class="keyword">const</span>;
<a name="l00372"></a>00372 
<a name="l00379"></a>00379         <span class="keywordtype">double</span> <a class="code" href="classQVVector.html#ac58dcee99e36a0d26cf006aafb6cb860" title="Standard deviation.">variance</a>() <span class="keyword">const</span>;
<a name="l00380"></a>00380 
<a name="l00398"></a>00398         <span class="keywordtype">double</span> <a class="code" href="classQVVector.html#a25d1e2fa44bf8ecd106a241e7d93211b" title="Shannon&amp;#39;s entropy of a probability state vector.">entropy</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> base = 2) <span class="keyword">const</span>;
<a name="l00399"></a>00399 
<a name="l00404"></a>00404         <span class="keywordtype">double</span> <a class="code" href="classQVVector.html#a9f5e5261bace97f7f315444be9992790" title="Vector dot product.">dotProduct</a>(<span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;vector) <span class="keyword">const</span>;
<a name="l00405"></a>00405 
<a name="l00411"></a>00411         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#aa2784fe126cba704e1801fcfa3b36e30" title="Vector cross product.">crossProduct</a>(<span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;vector) <span class="keyword">const</span>;
<a name="l00412"></a>00412 
<a name="l00417"></a>00417                 <a class="code" href="classQVMatrix.html" title="Implementation of numerical matrices.">QVMatrix</a> <a class="code" href="classQVVector.html#a6c796d6ed02dd3b04db75e97e92b7fcb" title="Outer product with another vector (to obtain a matrix).">outerProduct</a>(<span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;vector) <span class="keyword">const</span>;
<a name="l00418"></a>00418 
<a name="l00423"></a>00423         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a15bf38ec2d56c24537e118b11bdd1ad7" title="Vector add.">add</a>(<span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;vector) <span class="keyword">const</span>;
<a name="l00424"></a>00424 
<a name="l00429"></a>00429         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a6aeacd80798f80447989c0cb016c7a48" title="Vector substraction.">substract</a>(<span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;vector) <span class="keyword">const</span>;
<a name="l00430"></a>00430 
<a name="l00435"></a>00435         <span class="keywordtype">bool</span> <a class="code" href="classQVVector.html#acd3cdacd7ad33bfd723ce694a707f5e7" title="Compare operator.">equals</a>(<span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;vector) <span class="keyword">const</span>;
<a name="l00436"></a>00436 
<a name="l00438"></a>00438 
<a name="l00449"></a>00449         <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a615053c57c2d85dce8b77622debdab9f" title="Vector of Gaussian distributed values.">gaussianVector</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> radius, <span class="keyword">const</span> <span class="keywordtype">double</span> sigma);
<a name="l00450"></a>00450 
<a name="l00456"></a>00456         <span class="keyword">static</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#ac550cb33a94138c6a55901bc2dc23558" title="Creates a vector of random values.">random</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> elements);
<a name="l00457"></a>00457 
<a name="l00468"></a>00468         <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#a2423f32fab62271dd0dc0dfb6ba6f4cb" title="Vector of mexican hat wavelet distributed values.">mexicanHatWaveletVector</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> radius, <span class="keyword">const</span> <span class="keywordtype">double</span> sigma);
<a name="l00469"></a>00469 
<a name="l00473"></a>00473         <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#af8e81c72e88b61e1f9a8d118f8120c23" title="Obtains the vector in homogeneous coordinates.">homogeneousCoordinates</a>(<span class="keyword">const</span> QPointF &amp;point);
<a name="l00474"></a>00474 
<a name="l00480"></a>00480         <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="classQVVector.html#af8e81c72e88b61e1f9a8d118f8120c23" title="Obtains the vector in homogeneous coordinates.">homogeneousCoordinates</a>() <span class="keyword">const</span>;
<a name="l00481"></a>00481 
<a name="l00502"></a>00502         <a class="code" href="classQVMatrix.html" title="Implementation of numerical matrices.">QVMatrix</a> <a class="code" href="classQVVector.html#a70bc159ef037b663898798140f1d2a59" title="Obtain the matrix corresponding to the matrix multiplication notation for the vector...">crossProductMatrix</a>() <span class="keyword">const</span>;
<a name="l00503"></a>00503 
<a name="l00505"></a>00505         <a class="code" href="classQVMatrix.html" title="Implementation of numerical matrices.">QVMatrix</a> <a class="code" href="classQVVector.html#a54fddac966be9af0f7fce89b87b5cd48" title="Returns this vector in the form of a row matrix.">toRowMatrix</a>() <span class="keyword">const</span>;
<a name="l00506"></a>00506 
<a name="l00508"></a>00508         <a class="code" href="classQVMatrix.html" title="Implementation of numerical matrices.">QVMatrix</a> <a class="code" href="classQVVector.html#a57387ffc7c1b3ee7de38adb5155d3707" title="Returns this vector in the form of a column matrix.">toColumnMatrix</a>() <span class="keyword">const</span>;
<a name="l00509"></a>00509     };
<a name="l00510"></a>00510 
<a name="l00516"></a>00516 <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="qvmatrix_8cpp.html#a487146b8bf0d9fa878ac70f07db27ba9" title="Matrix-scalar product.">operator*</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> value, <span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;);
<a name="l00517"></a>00517 
<a name="l00523"></a>00523 <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="qvmatrix_8cpp.html#a7bd034eee5dffb1811c3012483e57f81" title="Matrix-scalar addition.">operator+</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> value, <span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;);
<a name="l00524"></a>00524 
<a name="l00530"></a>00530 <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> <a class="code" href="qvmatrix_8cpp.html#a5f3ee33a44f26d22ea440be723fe2858" title="Matrix-scalar substraction operator.">operator-</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> value, <span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;);
<a name="l00531"></a>00531 
<a name="l00534"></a>00534 std::ostream&amp; operator &lt;&lt; ( std::ostream &amp;os, <span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;vector );
<a name="l00535"></a>00535 
<a name="l00538"></a>00538 uint qHash(<span class="keyword">const</span> <a class="code" href="classQVVector.html" title="Implementation of numerical vectors.">QVVector</a> &amp;vector);
<a name="l00539"></a>00539 
<a name="l00540"></a>00540 <span class="preprocessor">#endif</span>
<a name="l00541"></a>00541 <span class="preprocessor"></span>
</pre></div></div>
</td></tr></table>

<br /><hr><br />
<center><a href="http://perception.inf.um.es/QVision">QVision framework</a>.
<a href="http://perception.inf.um.es">PARP research group</a>.
Copyright &copy; 2007, 2008, 2009, 2010, 2011.</center>
<br />
</body>
</html>
